<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-goodsSort-edit" th:object="${goodsSort}">
            <input id="sortId" name="sortId" th:field="*{sortId}"  type="hidden">
            <div class="form-group">	
                <label class="col-sm-3 control-label">分类排序：</label>
                <div class="col-sm-8">
                    <input id="sortSort" name="sortSort" th:field="*{sortSort}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">分类名称：</label>
                <div class="col-sm-8">
                    <input id="sortName" name="sortName" th:field="*{sortName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "store/goodsSort"
		$("#form-goodsSort-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
				sortName:{
        			required:true,
        		},
			},
			submitHandler: function(form) {
				$.operate.save(prefix + "/edit", $('#form-goodsSort-edit').serialize());
			}
		});
		
		// h所有修改，光标默认定位在第1个输入框
		var oldVal=$('input:eq(1)').val();
		$('input:eq(1)').val("").focus().val(oldVal);
	</script>
</body>
</html>
